package com.cheetah.start.module.system.domain;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.cheetah.start.common.base.BaseEntity;
import com.cheetah.start.common.base.validation.Add;
import com.cheetah.start.common.base.validation.Edit;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

/**
 * 系统管理员
 *
 * @author xjh
 * @date 2021/08/15
 */
@EqualsAndHashCode(callSuper = true)
@Data
@TableName(value = "sys_admin")
public class SysAdmin extends BaseEntity {

    /**
     * 管理员
     */
    @TableId(value = "admin_id")
    @NotNull(message = "ID不能为空", groups = {Edit.class})
    private Integer adminId;

    /**
     * 账号
     */
    @NotBlank(message = "账号不能为空", groups = {Edit.class, Add.class})
    private String name;

    /**
     * 密码
     */
    @NotBlank(message = "密码不能为空", groups = {Add.class})
    private String password;

    /**
     * 真实姓名
     */
    private String realName;

    /**
     * 角色 id
     */
    @TableField(exist = false)
    private String roleIds;

    /**
     * 性别
     */
    private String sex;
}
